home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / MODEMPRO / TELESHAR.ZIP;1 / DOCHELP@.EXE / SCRIPT.DOC < prev    next >
Encoding:
Text File  |  1993-08-06  |  21.8 KB  |  560 lines

  1.  
  2.                     The Script Language Manual      Page 1
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                         _______
  11.                    ____|__     |               (R)
  12.                 --|       |    |-------------------
  13.                   |   ____|__  |  Association of
  14.                   |  |       |_|  Shareware
  15.                   |__|   o   |    Professionals
  16.                 -----|   |   |---------------------
  17.                      |___|___|    Member
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.           Table of Contents                       Page #
  26.  
  27.            1   Introduction                           1
  28.            2   A script language sample
  29.            3   THE LANGUAGE                           2
  30.                    BATCH
  31.                    BEEP                               3
  32.                    BROWSE
  33.                    CD or CHDIR
  34.                    DELAY(seconds)
  35.                    DONE  (or END)
  36.                    DOS_MENU
  37.                    ECHO
  38.                    END
  39.                    ENDBATCH
  40.                    ENDLIST
  41.                    EQUIPMENT
  42.                    ERASE
  43.                    GET
  44.                    GETTEXT                            4
  45.                    GETLIST
  46.                    LOOP
  47.                    MACROS                             5
  48.                    MKDIR
  49.                    MODEM_XXX
  50.                    NOCLS or NOCLEAR
  51.                    NOSWAP                             6
  52.                    PASSWORD
  53.                    PAUSE or WAIT
  54.                    QUIT
  55.                    QUIT_TO
  56.                    RAM
  57.                    REM or #
  58.                    RUN
  59.                    TEXT
  60.  
  61.  
  62.  
  63.  
  64.                     The Script Language Manual      Page 2
  65.  
  66.                    TIME
  67.                    WAIT
  68.                    $(macro)                          7
  69.            4   XBASE language maintenance commands
  70.                    DBF_DELETE
  71.                    DBF_PACK
  72.                    DBF_RECALL
  73.                    DBF_RECCOUNT
  74.                    DBF_RECNO
  75.                    DBF_STRUCTURE
  76.                    DBF_ZAP
  77.             5  General notes and Warranty            7
  78.  
  79.  
  80.  
  81.           1 Introduction
  82.  
  83.           The TeleShare Phone, or TSPHONE, system has a built in DOS
  84.           menu program that uses the script language, as does the Open
  85.           Menu.
  86.  
  87.  
  88.           2 A script language sample:
  89.  
  90.           For example, using Word Perfect's WP.exe.  The description
  91.           could be WordPerf and the action could be as follows.
  92.  
  93.           REMark  to run Word Perfect 6
  94.           CHDIR \WP6    # change to the directory
  95.           WP GET NOCLEAR # run WP after swapping out.
  96.  
  97.           CHDIR changes to the \WP6 directory.  WP runs Word Perfect
  98.           without pre-clearing (NOCLEAR) the screen.  The 'GET' is the
  99.           parameter.  In this case the program will ask you for a file
  100.           name, such as 'myletter' and then feed your response as a
  101.           parameter or filename to WP.  After using Word Perfect the
  102.           program will automatically return both you and it to its
  103.           'home' or start up directory.  Its a good idea to review the
  104.           existing examples in the main program.
  105.  
  106.            3 THE LANGUAGE
  107.  
  108.           The following material is a basic description of the
  109.           language.  It is a good idea to peruse the language used in
  110.           the included samples.  The xbase commands are given in a
  111.           separate area following the rest.  When the program is run by
  112.           another program, as in "TSPHONE -N12" to run entry # 12 the
  113.           interactive commands (like BROWSE) are disabled with the idea
  114.           that other software does not want interactive use.  However,
  115.           you can use the -A- command line switch to disable this
  116.           behaviour for tutorials and the like.  Study the examples,
  117.           learning by example is good stuff.
  118.  
  119.  
  120.           BATCH indicates the start of an encapsulated batch file.
  121.           Batch files can be stored inside the script entries and run as
  122.  
  123.  
  124.  
  125.  
  126.                     The Script Language Manual      Page 3
  127.  
  128.           needed.  By default they remain on disk after use, so you need
  129.           to erase them after each use.  To create and run the batch
  130.           file on disk you need to provide its name as in:
  131.  
  132.           # Not an especially fancy batch file, but its easy to see
  133.           # how to set one up.
  134.           BATCH  TEST.BAT # the name of the batch file.
  135.             ECHO OFF
  136.             ECHO  HI
  137.             DIR/W
  138.             PAUSE
  139.           ENDBATCH
  140.           test.bat NOSWAP # to run TEST.BAT without swapping
  141.                           # the script program to disk.
  142.           ERASE test.bat  # erase TEST.bat from disk, but retain
  143.           END               it in the script entry.  Optionally use END
  144.                             to denote the end of the script entry.
  145.  
  146.           NOTE THAT ANY KIND OF TEXT OR ASCII FILE CAN BE STORED WITHIN
  147.           A BATCH/ENDBATCH SET.  Also, if you to setup a name like
  148.           "CONFIG", the system will automatically add the ".BAT" to
  149.           become "CONFIG.BAT" which may not be what you want.  Either
  150.           add a "." as in "CONFIG." or something like "CONFIG.CFG" to
  151.           keep both you and the script interpreter happy.
  152.  
  153.  
  154.           You can use the file creation feature to restrict access to
  155.           information in files, by creating hard to access file names
  156.           like "My test".  You can create batch files with names like
  157.           "MY TEST.BAT" but you may have difficulty running them.  Use
  158.           ALT-255 for the blank to generate such batch files that are
  159.           designed to and will be run from the script but not by a user
  160.           from the DOS command line.  The BROWSE and ERASE can access
  161.           such files, but the scheme does provide basic security.
  162.  
  163.           You may give all the encapsulated batch files the same name,
  164.           with the understanding that each overwrites the previous (if
  165.           it was not erased) when it is run.  When they are run from the
  166.           script the batch file name generated on disk matters only to
  167.           the operating system and you do not need to gain meaning from
  168.           unique names.  Run a tool like (FFF) Fast File Find to find
  169.           all the batch files on your drives, then consider the space
  170.           and maintenance advantages from storing them in easily
  171.           maintained, and possibly access restricted, script entries.
  172.  
  173.  
  174.           Running TSR or resident programs from the script:
  175.  
  176.           Putting TSR programs in batch files, that also unload the
  177.           TSR's after use is a simple way to temporarily run TSR's from
  178.           the script.  Many TSR's have built in command line switches
  179.           that allow one to disable them.  Use something like the
  180.           MARK/RELEASE set on any others.
  181.  
  182.           # First, using /u to unload the TSR after use.  BATCH TSR.BAT
  183.           # a sample TSR batch file demo
  184.  
  185.  
  186.  
  187.  
  188.                     The Script Language Manual      Page 4
  189.  
  190.             echo off
  191.             sometsr
  192.             sometsr /u ENDBATCH
  193.  
  194.           # Second, using mark/release.  BATCH TSR.BAT mark sometsr
  195.           release ENDBATCH
  196.  
  197.           See also ENDBATCH.
  198.  
  199.           BEEP beeps.  See sound below.
  200.  
  201.           BROWSE indicates that you want to browse the file named on the
  202.           same line.  Use "BROWSE NOCLS" to avoid screen clearing.
  203.  
  204.           CD or CHDIR to change to the specified directory.  You may
  205.           change to restricted access directories like "\ WP\SEPT \
  206.           MINE" with the blanks being generated using the ALT key and
  207.           255 on the numeric keypad.  When access is via the script the
  208.           extra burden of access via the DOS command line is missing and
  209.           security is improved for a whole class of potential casual
  210.           browsers.  You may also use "CHDIR A:" to change to drive A:.
  211.           This is designed as a simplification over DOS, and as an
  212.           alternate to "A:  NOSWAP"
  213.  
  214.           DELAY(seconds) to delay 1 or more seconds up to 65535.  You
  215.           may tap any key to continue instead of waiting for the delay
  216.           time.
  217.  
  218.           DONE or END indicates the end of a set of script
  219.           instructions.  You may freely put comments after END or DONE.
  220.  
  221.           DOS_MENU switches the script to the DOS_MENU portion of the
  222.           phone program.
  223.  
  224.           ECHO to echo an instruction on screen.
  225.  
  226.           END to stop the script program from looking for more
  227.           instructions.  The use of END is entirely optional unless you
  228.           have your own notes following.  Normal text will likely cause
  229.           errors when the script trys to process it.
  230.  
  231.           ENDBATCH indicates the end of an encapsulated batch file.
  232.  
  233.           ENDLIST is used with GETLIST, see below.
  234.  
  235.           EQUIPMENT provides a simple equipment list.  If you put a file
  236.           or printer name on the same line, then the output is sent to
  237.           the specified destination.
  238.  
  239.           ERASE to erase a disk file without prompting you.
  240.  
  241.           GET to get the script to prompt you for a parameter.  Such as
  242.           the file name for your word processor or spreadsheet to load
  243.           up.  You may change the help that pops up when you tap F1 when
  244.           using a GET.  Use GETTEXT for specific help for each separate
  245.           GET.  Add the keyword COMMAND when you want to have DOS's
  246.  
  247.  
  248.  
  249.  
  250.                     The Script Language Manual      Page 5
  251.  
  252.           COMMAND.COM directly run whatever you input to the GET.
  253.  
  254.           GETTEXT is used to include help with the GET, see TEXT and the
  255.           example below.
  256.  
  257.           Example:
  258.           GETTEXT
  259.               Provide the filename to be loaded into the word processor.
  260.           ENDTEXT
  261.           WordProc GET
  262.           # or in a more generic form, where you provide the program name.
  263.           COMMAND GET # Include the COMMAND command to indicate that you
  264.           # want to have DOS run whatever you input.
  265.           WP
  266.  
  267.           GETLIST is used to provide a list of parameters for the
  268.           program to be run.  Provide one set of parameters, up to 60
  269.           characters long, per line.  End the list with the command
  270.           ENDLIST.  You may include a suitable description of the list
  271.           on the same line as the GETLIST command, and add notes after a
  272.           # on the same line as individual entries.  You may also
  273.           add/change the help that pops up when you tap F1 at a
  274.           GETLIST.
  275.  
  276.           Example:
  277.  
  278.           GETLIST   Choose one of these files to load into the editor.
  279.            newmail
  280.            oldmail
  281.            today.now # a runt.exe script file
  282.            script.DOC
  283.            *.prg # to edit the local xbase .prg files
  284.            *.*
  285.           ENDLIST
  286.           # ENDLIST q  # alternate format.
  287.           clear # to pre clear the screen
  288.           q # q for semware's qedit.
  289.           # Use COMMAND to just run whatever it is.
  290.  
  291.           LOOP to tell the script program to go back and look some
  292.           more.
  293.  
  294.           MACROS and the startup entry script.  When the program first
  295.           starts up it looks for the "SETUP" entry in the EVENTS filter
  296.           field called SETUPMACRO.  This entry is automatically executed
  297.           when the TSPHONE program starts up to create the global macros
  298.           and do any other setup procedures that you need done at that
  299.           time.  You can run any normal script or DOS commands in this
  300.           SETUP entry.  Yes, you may run CHKDSK, or other 'first thing
  301.           in the morning' things, from this entry.
  302.  
  303.           Technical notes:
  304.           The SETUP entry's FILTER field has the value "SETUPMACRO".
  305.           The IDENTITY and PHONE entries' are described as "SETUP
  306.           SETUP".  The date is just "SETUP".  The MESSAGE is "General
  307.           configuration".  You will notice the "SETUP SETUP" in the
  308.  
  309.  
  310.  
  311.  
  312.                     The Script Language Manual      Page 6
  313.  
  314.           Session menu and in the EVENTS editing screen.
  315.  
  316.           FILTERs are described online and in the TSPHONE/OPMENU
  317.           manuals.  They allow you to manage or restrict your view of
  318.           the system to a specifed subset by group or filter, including
  319.           up to 5 groups.
  320.  
  321.           Macros
  322.           The macros all use the $(MACRO) scheme used in the M4 macro
  323.           language used by make tools.  There are three forms of macro:
  324.           global, local, and built-in.
  325.  
  326.           The description $(THISPART) portion of the macro can be up to
  327.           10 characters long, and the association action or replacement
  328.           string can be up to 60 characters long.
  329.  
  330.           An example macro follows:
  331.  
  332.           MY_COLOR = Red, or maybe blue.
  333.  
  334.           $(MY_COLOR) would be replaced by "Red, or maybe blue." when it
  335.           is found in an entry (without the surrounding "").  Check out
  336.           the examples in the session menu or events edit area.
  337.  
  338.           If this MY_COLOR macro is placed in the SETUP entry it is a
  339.           global macro.  Up to 40 global macros macros can be setup in
  340.           the SETUP entry.  They will then remain in effect for use as
  341.           $(MY_COLOR) in any other entry.
  342.  
  343.           If the the macro is created in any entry other than the SETUP
  344.           entry, then it is one of up to 40 LOCAL macros that have
  345.           effect only in the individual entry.
  346.  
  347.           The Built-in macros are designed for very common tasks and
  348.           values that are stored in the general setup database
  349.           GENSETUP.DBF.
  350.  
  351.  
  352.           Built-in macros:
  353.  
  354.           $(DATE)  expands to a date such as                14/06/93
  355.           $(DAY)   expands to the day of the month such as  14
  356.           $(HOUR)  expands to the hour of the day such as   14
  357.           $(BAUD)  expands to the supplied baud value as in 2400
  358.           stored in the gensetup.dbf managed by GENMGR.exe.
  359.           $(PHONENUM) expands to the supplied phone number.
  360.           $(ANSWER) expands to the phone answer string stored
  361.           in the gensetup.dbf managed by GENMGR.exe.
  362.           $(HANGUP) expands to the phone hangup string stored
  363.           in gensetup.dbf.
  364.  
  365.           You might also review the MODEM_XXX commands, such as
  366.           MODEM_BAUD.
  367.  
  368.           The most common use for the $(DAY)$(HOUR) macros is automatic
  369.           creation of backup files that change names daily and hourly.
  370.  
  371.  
  372.  
  373.  
  374.                     The Script Language Manual      Page 7
  375.  
  376.           Running a script with "LHA U BACK$(DAY)$(HOUR) *.DBF" would
  377.           tell the lha archive program to update/create a file called
  378.           BACK1310.LZH from the local .DBF database files if it was run
  379.           on the 13th day of the month at 10 AM.  For example, the
  380.           source code and documentation for TSPHONE is continually
  381.           archived onto diskettes using such a scheme.  It allows us to
  382.           go back to a version for a certain day and hour to find
  383.           something, or to recreate it when necessary.
  384.  
  385.  
  386.           The MODEM_XXX commands actually contain the values matching
  387.           the modem you selected in the modem database.  They can be
  388.           used inside a BATCH/ENDBATCH set.
  389.           MODEM_BAUD     the baud rate.
  390.           MODEM_COMPRESS the compression string.
  391.           MODEM_INIT     the initialization string.
  392.           MODEM_NAME     the name or modem description.
  393.           MODEM_PROTOCOL the protocol string.
  394.  
  395.           MKDIR to create a directory.  Several subdirectories can be
  396.           created at once as in "MKDIR \CHAP1\FIGURES\NEW".  There is no
  397.           matching RMDIR, use rmtree instead.  Use ALT and 255 for any
  398.           embedded blanks in the directory names, as in "MKDIR \HARD
  399.           TO\GET\TO" as a mild form of security.
  400.  
  401.           NOCLS or NOCLEAR to suppress screen clearing before running.
  402.           The script default is to clear the screen before running
  403.           another program.
  404.  
  405.           NOSWAP to prevent swapping all but 2K of the script program to
  406.           disk before running an external program.  Swapping offers much
  407.           more RAM for bigger applications.  The current script default
  408.           is to swap all but 2K of the script program to disk before
  409.           running an external program.
  410.  
  411.           PASSWORD protection is only basically enabled in order to keep
  412.           the program easier to use.  However, adding a password in the
  413.           Password field in the general setup entry for the script
  414.           program will limit access to the script and inhibit user
  415.           changes to the script entries.  Naturally, knowledgeable Xbase
  416.           users can step around this barrier in a few minutes.  A
  417.           PASSWORD keyword for the script language will be implemented
  418.           upon sufficient user demand.  See the PASSWORD section below.
  419.  
  420.           PAUSE or WAIT to wait after running a program.  Use it just
  421.           like a batch file pause, to allow review of the program's
  422.           results.  It is currently enabled as a user changeable long
  423.           delay for interactive use, and 1 second when TSPHONE is run by
  424.           another program to aid remote control of script entries.  A
  425.           true wait could wreck a whole night's automated operations.
  426.           If you are creating a 'programmed' tutorial or demonstration
  427.           use delay(seconds) instead of wait for more control.
  428.  
  429.           QUIT to quit or kill the script program.  QUIT_TO some_exe to
  430.           quit and run the next program without returning to the
  431.           original program.  You need to keep the program short;  do not
  432.  
  433.  
  434.  
  435.  
  436.                     The Script Language Manual      Page 8
  437.  
  438.           include the directory name.  If you have to run the other
  439.           program in a specific directory, then CD/CHDIR to that
  440.           directory first.
  441.  
  442.           RAM to show the available free RAM memory at column 70, before
  443.           any swapping.  If you want to run a program called "RAM" add a
  444.           WAIT on the same command line.
  445.  
  446.           REM or # for remarks.
  447.  
  448.           RUN to run an external program.  NOSWAP implies a RUN without
  449.           swapping. The script will default to swapping all but 2K of
  450.           itself to disk when it "RUN"s a program.  If you put "234" on
  451.           a line by itself, the "RUN" is implied and any 234.exe or bat
  452.           is run.
  453.  
  454.  
  455.           TEXT when found on columns 1-4 (far left side) tells the
  456.           script that you want to browse the contents of the entry, as
  457.           an expansion on the help scheme for general usage.  That is,
  458.           instead of a program to run it becomes an on-line help area.
  459.           The maximum line length should be less than 120 characters.
  460.            A variant is GETTEXT that matchs the help to a particular
  461.           GET.  Replace the TEXT with GETTEXT and add your get just
  462.           below it.
  463.  
  464.           TIME to display the time at column 70 on the screen.  If you
  465.           need to set the DOS TIME, either shell to DOS or add a WAIT on
  466.           the same command line.
  467.  
  468.           WAIT to pause after running a program.  TSPHONE starts up
  469.           thinking a WAIT or PAUSE is 15 seconds, then reads in the
  470.           general configuration/setup information from GENSETUP.DBF and
  471.           changes its mind to suit those settings.  Whenever TSPHONE is
  472.           run by another program the WAIT time is automatically reduced
  473.           to 1 second.  This is based on the assumption that such
  474.           automatic operations are not designed for user participation.
  475.  
  476.           $(whatever). M4 macro or MAKE language capability has
  477.           restricted capability in this version.  For full capability,
  478.           use M4 or MAKE instead.  Ask for a free copy of M4 or MAKE if
  479.           needed.
  480.  
  481.           They are used as in $(PORT) as part of script entries.
  482.  
  483.  
  484.           4 XBASE language maintenance commands
  485.  
  486.           The XBASE commands work, as maintenance commands, on the
  487.           internal EVENTS.DBF and EVENTS.DBT database system.  They do
  488.           exactly what the similar dBASE/Xbase commands do.  However, if
  489.           you use a dbf_DELETE command you should expect that entry to
  490.           be deleted so you cannot continue to run that particular
  491.           script.  If you use dbf_ZAP, you clean out the database.
  492.  
  493.           The currently available database commands are:
  494.  
  495.  
  496.  
  497.  
  498.                     The Script Language Manual      Page 9
  499.  
  500.           DBF_DELETE To delete the current entry.
  501.  
  502.           DBF_PACK To permanently remove previously deleted entries.
  503.  
  504.           DBF_RECALL To undelete previously deleted entries.
  505.  
  506.           DBF_RECCOUNT To display the number of entries.
  507.  
  508.           DBF_RECNO To display the current record/entry number.
  509.  
  510.           DBF_STRUCTURE To display the EVENTS.DBF file structure.
  511.  
  512.           DBF_ZAP To basically clean out the EVENTS database.  If you
  513.           have cleaned out the database, it might be useful to replace
  514.           it with a copy from the original disks.
  515.  
  516.  
  517.           5 General notes and Warranty
  518.  
  519.           This manual is a sub-section of the main manual, to make it
  520.           easier to use.  Please use the main manual for for more
  521.           information.
  522.  
  523.           THE DOCUMENTATION AND ASSOCIATED SOFTWARE ARE DISTRIBUTED AND
  524.           SOLD WITH NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING
  525.           ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE.
  526.           THE INFORMATION IN THIS DOCUMENTATION IS SUBJECT TO CHANGE
  527.           WITHOUT NOTICE AND DOES NOT REPRESENT A COMMITTMENT ON THE
  528.           PART OF THE VENDOR.
  529.  
  530.           OTHER PRODUCT AND BRAND NAMES MENTIONED ARE TRADEMARKS OR
  531.           REGISTERED TRADEMARKS OF THEIR RESPECTIVE HOLDERS.
  532.           SPECIFICALLY XBASE IS THE GENERIC DATABASE INDUSTRY
  533.           REPLACEMENT FOR THE REGISTERED TERM 'DBASE' OWNED BY BORLAND
  534.           INTERNATIONAL.
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.